package org.windowkit.toolkit.widget.treetable;

import java.util.ArrayList;
import java.util.List;

import javax.swing.tree.TreeModel;

import org.ddevil.data.Data;
import org.ddevil.data.DisplayDescriptor;
import org.ddevil.data.KeyedChangeTracker.KeyedChange;
import org.ddevil.data.set.DataSet;
import org.ddevil.data.set.SortableDataSet;


/**
 * This interface combines a tree model with the important parts of a table
 * model.
 *
 * @author Eric Lundin
 */
public interface TreeTableModel extends TreeModel {
	public int getColumnCount();

	public String getColumnName(int column);

	public Class< ? > getColumnClass(int column);

	public Object getValueAt(Object node, int column);

	public boolean isCellEditable(Object node, int column);

	public void setValueAt(Object aValue, Object node, int column);

	public void setLabelsAndKeys(DisplayDescriptor labels,
			ArrayList<ArrayList<String>> keys);

	public void setChangeExportKeys(ArrayList<ArrayList<String>> exportAttribs);

	public void setData(SortableDataSet data);

	public List<KeyedChange> getChanges();

	public void addRecord(Data record);

	public boolean deleteRow(Data atts, int level);

	public boolean modifyRecord(Data oldValue, String dbId,
			Object value, int level);

	public void clearData();

	public int getDataLevel(Object node);

	public int getLevel(Object node);

	public DisplayDescriptor getDisplayDescriptor();

	public void setEditableColumns(ArrayList<String> editableColumns);

	public int getIndexOfId(String dbId);

	public void clearChanges();

	public void setAutoClearChangeTracker(boolean auto);

	public DataSet getDataForNode(Object node);

	public ArrayList<String> getKeysForNode(Object node);

}
